package org.example;

public class Main {
    public static void main(String[] args) {
        final long time1 = System.currentTimeMillis();
        long[] result = null;
        // 1亿次的整数递增、递减混合运算
        for (int i = 1; i <= 10; i++) {
            result = YyAddSub(0, 100000000);
        }
        long costTime = System.currentTimeMillis() - time1;
        System.out.printf("单次平均耗时：%d ms, 结果:( %d, %d)", costTime / 10, result[0], result[1]);
    }

    static long[] YyAddSub(long N1, long N2) {
        for (int i = 1; i <= 100000000; i++) {
            N1++;
            N2--;
        }
        return new long[]{N1, N2};
    }
}